<?php if ($this->signup): ?>
    <div class="alert alert-info">
        Hi <?= $this->session->username ?>, welcome to Disputeo!
    </div>
<?php endif ?>

<?php if ($this->post): ?>
    <div class="alert alert-info">
        <?= $this->session->username ?>, your post was added to Disputeo.
    </div>
<?php endif ?>

<div class="row-fluid">
    <div class="span9">
        <?php echo $this->frontPageTabsHelper() ?>
        <div class="tab-content">
            <div id="top" class="tab-pane fade <?php echo $this->active == 'top' ? 'active in' : '' ?>">
                <?php foreach ($this->top as $dispute): ?>
                    <?php echo $this->partial('partials/dispute.phtml', array(
                        'dispute' => $dispute,
                        'type' => 'top',
                        'loggedIn' => !is_null($this->session->username)
                    )) ?>
                <?php endforeach ?>
                <div class="row-fluid">
                    <?php echo $this->partial('partials/paginator.phtml', array(
                        'pages' => $this->top->getPages(),
                        'pageNumber' => $this->top->getCurrentPageNumber(),
                        'url' => '/top'
                    )) ?>
                </div>
            </div>
            <div id="new" class="tab-pane fade <?php echo $this->active == 'new' ? 'active in' : '' ?>">
                <?php foreach ($this->new as $dispute): ?>
                    <?php echo $this->partial('partials/dispute.phtml', array(
                        'dispute' => $dispute,
                        'type' => 'new',
                        'loggedIn' => !is_null($this->session->username)
                    )) ?>
                <?php endforeach ?>
                <div class="row-fluid">
                    <?php echo $this->partial('partials/paginator.phtml', array(
                        'pages' => $this->new->getPages(),
                        'pageNumber' => $this->new->getCurrentPageNumber(),
                        'url' => '/new'
                    )) ?>
                </div>
            </div>
            <div id="open" class="tab-pane fade <?php echo $this->active == 'open' ? 'active in' : '' ?>">
                <?php foreach ($this->open as $dispute): ?>
                    <?php echo $this->partial('partials/dispute.phtml', array(
                        'dispute' => $dispute,
                        'type' => 'open',
                        'loggedIn' => !is_null($this->session->username)
                    )) ?>
                <?php endforeach ?>
                <div class="row-fluid">
                    <?php echo $this->partial('partials/paginator.phtml', array(
                        'pages' => $this->open->getPages(),
                        'pageNumber' => $this->open->getCurrentPageNumber(),
                        'url' => '/open'
                    )) ?>
                </div>
            </div>
            <div id="post" class="tab-pane fade <?php echo $this->active == 'post' ? 'active in' : '' ?>">
                <?php echo $this->form ?>
            </div>
        </div>
    </div>
    <div class="span3">
        <?php echo $this->frontPageCategoriesHelper() ?>
        <ul class="pager">
            <li><a href="#">&larr; Newer</a></li>
            <li><a href="#">Older &rarr;</a></li>
        </ul>
    </div>
</div>